package com.spring.bean;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * Description:
 *
 * @author lijie
 * @create 2019-01-16 0:24
 * Update by lijie 2019-01-16 0:24
 */
public class Dog implements ApplicationContextAware {

    private ApplicationContext applicationContext;

    public Dog(){
        System.out.println("Dog 构造方法");
    }
    @PostConstruct
    public void init(){
        System.out.println("Dog 初始化方法");
    }
    @PreDestroy
    public void destory(){
        System.out.println("Dog 销毁方法");
    }


    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }
}
